package com.zwy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zwy.domain.entity.BlackList;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

/**
 * @author zwy
 * @version 1.0
 * @description: BlackListMapper
 * @date 2025/9/24 19:57
 */
public interface BlackListMapper extends BaseMapper<BlackList> {

    @Delete("DELETE FROM t_black_list WHERE ip_info -> '$.createIp' = #{ip}")
    Long deleteByIp(String ip);

    // 查询是否存在ip
    @Select("SELECT id FROM t_black_list WHERE ip_info -> '$.createIp' = #{ip}")
    Long getIdByIp(String ip);
}
